<?php

namespace app\api\model;

use think\Model;
use think\model\concern\SoftDelete;

class FolderModel extends Model
{
    protected $name = 'folder';

    use SoftDelete;
    protected $defaultSoftDelete = 0;
    protected $deleteTime = 'delete_time';

    public function getFinishTimeAttr($value)
    {
        return date('Y-m-d',$value);
    }

    public function department()
    {
        return $this->belongsTo(DepartmentModel::class, 'department_id');
    }

    public function process()
    {
        return $this->belongsTo(ProcessModel::class, 'process_id');
    }

    public function user()
    {
        return $this->belongsTo(UserModel::class, 'user_id');
    }
}